<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>vstparamset,vstparamget</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="vstnote.html" title="vstnote" />
    <link rel="next" href="vstprogset.html" title="vstprogset" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">vstparamset,vstparamget</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="vstnote.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="vstprogset.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="vstparamset"></a>
      <div class="titlepage"></div>
      <a id="IndexVstParamSet" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">vstparamset,vstparamget</span>
        </h2>
        <p>vstparamset — Used for parameter comunication to and from a VST plugin.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp166474192"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>vstparamset </strong></span>instance, kparam, kvalue</pre>
        <pre class="synopsis">kvalue <span class="command"><strong>vstparamget </strong></span>instance, kparam</pre>
      </div>
      <div class="refsect1">
        <a id="idp166543408"></a>
        <h2>Description</h2>
        <p><span class="emphasis"><em>vstparamset</em></span> and <span class="emphasis"><em>vstparamget</em></span> are used for parameter comunication to and from a VST plugin.</p>
      </div>
      <div class="refsect1">
        <a id="idp166545296"></a>
        <h2>Initialization</h2>
        <p><span class="emphasis"><em>instance</em></span> - the number which identifies the
      plugin, to be passed to other vst4cs opcodes.</p>
      </div>
      <div class="refsect1">
        <a id="idp166546960"></a>
        <h2>Performance</h2>
        <p><span class="emphasis"><em>kparam</em></span> - The number of the parameter to set or get.</p>
        <p><span class="emphasis"><em>kvalue</em></span> - the value to set, or the the value returned by the plugin.</p>
        <p>Parameters vary according to the plugin. To find out what
      parameters are available, use the verbose option when loading the
      plugin with vstinit. Note that the VST protocol specifies that all parameter values must lie between 0.0 and 1.0, inclusive.</p>
      </div>
      <div class="refsect1">
        <a id="idp166550432"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the use of the <span class="emphasis"><em>vstparamset</em></span> opcode. It uses the file <a class="ulink" href="examples/vst4cs.csd" target="_top"><em class="citetitle">vst4cs.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp166552736"></a>
          <p class="title">
            <strong>Example 1028. Example of the <span class="emphasis"><em>vstparamset</em></span> opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Credits: Adapted by Michael Gogins </span>
<span class="comment">; from code by David Horowitz and Lian Cheung. </span>
<span class="comment">; The "--displays" option is required in order for </span>
<span class="comment">; the Pianoteq GUI to dispatch events and display properly.</span>
-m3 --displays -odac
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">sr</span>     <span class="op">=</span> 44100
<span class="ohdr">ksmps</span>  <span class="op">=</span> 20
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
                <span class="comment">; Load the Pianoteq into memory.</span>
gipianoteq      <span class="opc">vstinit</span>         "C<span class="op">:</span>\\Program Files\\Steinberg\\VstPlugins\\Pianoteq 3.0 Trial\\Pianoteq30 Trial.dll", 1
                
                <span class="comment">; Print information about the Pianoteq, such as parameter names and numbers.</span>
                <span class="opc">vstinfo</span>         gipianoteq
                
                <span class="comment">; Open the Pianoteq's GUI.</span>
                <span class="opc">vstedit</span>         gipianoteq

                <span class="comment">; Send notes from the score to the Pianoteq.</span>
                <span class="oblock">instr</span> 1 
                <span class="comment">; MIDI channels are numbered starting at 0.</span>
                <span class="comment">; p3 always contains the duration of the note.</span>
                <span class="comment">; p4 contains the MIDI key number (pitch),</span>
                <span class="comment">; p5 contains the MIDI velocity number (loudness),</span>
imidichannel    <span class="opc">init</span>            0
                <span class="opc">vstnote</span>         gipianoteq, imidichannel, p4, p5, p3
                <span class="oblock">endin</span>

                <span class="comment">; Send parameter changes to the Pianoteq.</span>
                <span class="oblock">instr</span> 2 
                <span class="comment">; p4 is the parameter number.</span>
                <span class="comment">; p5 is the parameter value.</span>
                <span class="opc">vstparamset</span>     gipianoteq, p4, p5 
                <span class="oblock">endin</span>

                <span class="comment">; Send audio from the Pianoteq to the output.</span>
                <span class="oblock">instr</span> 3 
ablankinput     <span class="opc">init</span>            0
aleft, aright   <span class="opc">vstaudio</span>        gipianoteq, ablankinput, ablankinput
                <span class="opc">outs</span>            aleft, aright
                <span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="comment">; Turn on the instrument that receives audio from the Pianoteq indefinitely.</span>
<span class="stamnt">i</span> 3 0 -1
<span class="comment">; Send parameter changes to Pianoteq before sending any notes.</span>
<span class="comment">; NOTE: All parameters must be between 0.0 and 1.0.</span>
<span class="comment">; Length of piano strings:</span>
<span class="stamnt">i</span> 2 0 1 33 0.5
<span class="comment">; Hammer noise:</span>
<span class="stamnt">i</span> 2 0 1 25 0.1
<span class="comment">; Send a C major 7th arpeggio to the Pianoteq.</span>
<span class="stamnt">i</span> 1 1 10 60 76
<span class="stamnt">i</span> 1 2 10 64 73
<span class="stamnt">i</span> 1 3 10 67 70 
<span class="stamnt">i</span> 1 4 10 71 67
<span class="comment">; End the performance, leaving some time </span>
<span class="comment">; for the Pianoteq to finish sending out its audio,</span>
<span class="comment">; or for the user to play with the Pianoteq virtual keyboard.</span>
<span class="stamnt">e</span> 20
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp166557456"></a>
        <h2>Credits</h2>
        <p>By: Andrés Cabrera and Michael Gogins</p>
        <p>Uses code from Hermann Seib's VSTHost and Thomas Grill's vst~
      object.</p>
        <p>VST is a trademark of Steinberg Media Technologies GmbH. 
      VST Plug-In Technology by Steinberg.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="vstnote.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="vstprogset.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">vstnote </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> vstprogset</td>
        </tr>
      </table>
    </div>
  </body>
</html>
